package com.cykj.controller;

import com.cykj.dto.ResponseDTO;
import com.cykj.entity.OrdersDO;
import com.cykj.feign.ProDuctFeignClient;
import com.cykj.service.IOrderService;
import com.cykj.vo.OrdersVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Project:JDMS
 * Package:com.cykj.controller
 *
 * @Description:
 * @Author:其一
 * @CreateTime: 2025-07-24-12-45
 */
@RestController
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private IOrderService orderService;

    @Autowired
    private ProDuctFeignClient proDuctFeignClient;

    @RequestMapping("/selectAll")
    private ResponseDTO selectAllById(@RequestBody OrdersVO ordersVO){
        return orderService.selectAllById(ordersVO);
    }

    @RequestMapping("/buy")
    public ResponseDTO buy(Integer userId,Integer goodId,int count){
        return orderService.buy(userId,goodId,count);
    }

    @RequestMapping("/test")
    public String test(){
        return proDuctFeignClient.test();
    }
}
